import React from 'react';
import {Link} from 'react-router-dom';
import {useSelector} from 'react-redux';

const Header = () => {
    const {isLogin} = useSelector((state)=>state.login)
    
    return (
        <div style={{height:60,background:'#aaa'}}>
            <Link to='/'>首页</Link>
            <Link to='/about'>关于</Link>
            {
                isLogin
                ?<button>退出</button>
                :<Link to='/login'>登录</Link>
            }
            
        </div>
    )
}

export default Header
